# -*- mode: python -*-

Import("env")

env = env.Clone()

env.CppUnitTest(
    target="s_query_exec_test",
    source=[
        "async_results_merger_test.cpp",
        "blocking_results_merger_test.cpp",
        "cluster_client_cursor_impl_test.cpp",
        "cluster_client_cursor_mock.cpp",
        "cluster_cursor_manager_test.cpp",
        "cluster_exchange_test.cpp",
        "establish_cursors_test.cpp",
        "results_merger_test_fixture.cpp",
        "router_stage_limit_test.cpp",
        "router_stage_remove_metadata_fields_test.cpp",
        "router_stage_skip_test.cpp",
        "store_possible_cursor_test.cpp",
    ],
    LIBDEPS=[
        "$BUILD_DIR/mongo/db/auth/authmocks",
        "$BUILD_DIR/mongo/db/auth/saslauth",
        "$BUILD_DIR/mongo/db/query/query_request",
        "$BUILD_DIR/mongo/db/query/query_test_service_context",
        "$BUILD_DIR/mongo/db/service_context_non_d",
        "$BUILD_DIR/mongo/db/session/logical_session_id",
        "$BUILD_DIR/mongo/db/shared_request_handling",
        "$BUILD_DIR/mongo/db/vector_clock",
        "$BUILD_DIR/mongo/executor/thread_pool_task_executor_test_fixture",
        # Linking to cluster_commands is necessary for async_results_merger_test.cpp since it
        # requires linking to the getMore command. Otherwise the test fails due to a uassert
        # being thrown.
        "$BUILD_DIR/mongo/s/commands/cluster_commands",
        "$BUILD_DIR/mongo/s/commands/cluster_commands_common",
        "$BUILD_DIR/mongo/s/query/planner/cluster_aggregate",
        "$BUILD_DIR/mongo/s/sharding_mongos_test_fixture",
        "$BUILD_DIR/mongo/util/clock_source_mock",
        "async_results_merger",
        "cluster_cursor",
        "cluster_cursor_manager",
        "router_exec_stage",
    ],
)
